package com.android.butterknife;

import butterknife.Bind;
import butterknife.ButterKnife;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class ListDataAdapter extends BaseAdapter {
	private LayoutInflater mInflater;

	public ListDataAdapter(Context context) {
		mInflater = LayoutInflater.from(context);
	}

	@Override
	public int getCount() {
		return 20;
	}

	@Override
	public Object getItem(int position) {
		return null;
	}

	@Override
	public long getItemId(int position) {
		return 0;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		ViewHolder holder;
		if (convertView == null) {
			convertView = mInflater.inflate(R.layout.item_text_list, null);
			holder = new ViewHolder(convertView);
			convertView.setTag(holder);
		} else {
			holder = (ViewHolder) convertView.getTag();
		}
		holder.text.setText("John Doe position:" + position);
		return convertView;
	}

	class ViewHolder {
		@Bind(R.id.text)
		TextView text;

		public ViewHolder(View view) {
			ButterKnife.bind(this, view);
		}
	}

}
